<%#
 Copyright 2013-2018 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
version: '<%= DOCKER_COMPOSE_FORMAT_VERSION %>'
services:
    jhipster-elasticsearch:
        image: <%= DOCKER_JHIPSTER_ELASTICSEARCH %>
        # Uncomment this as well as the volume section down below
        # to have elasticsearch data persisted to a volume
        # you will need to create a named volume with `docker volume create log-data`
        #volumes:
        #   - log-data:/usr/share/elasticsearch/data
    jhipster-logstash:
        image: <%= DOCKER_JHIPSTER_LOGSTASH %>
        environment:
            - INPUT_TCP_PORT=5000
            - INPUT_UDP_PORT=5000
            - ELASTICSEARCH_HOST=jhipster-elasticsearch
            - ELASTICSEARCH_PORT=9200
            - LOGSTASH_DEBUG=false
        ports:
            - 5000:5000
            - 5000:5000/udp
        # Uncomment this section and add a logstash.conf file in log-conf/
        # to have logstash config loaded from a volume
        #volumes:
        #    - ./log-conf/:/usr/share/logstash/pipeline/
    jhipster-console:
        image: <%= DOCKER_JHIPSTER_CONSOLE %>
        environment:
            - ELASTICSEARCH_URL=http://jhipster-elasticsearch:9200
        ports:
            - 5601:5601
    jhipster-import-dashboards:
        image: <%= DOCKER_JHIPSTER_IMPORT_DASHBOARDS %>
        environment:
            - ELASTICSEARCH_URL=http://jhipster-elasticsearch:9200
    <%_ if (consoleOptions.includes('curator')) { _%>
    jhipster-curator:
        image: <%= DOCKER_JHIPSTER_CURATOR %>
        environment:
            - ES_HOST=jhipster-elasticsearch
            - UNIT_COUNT=7
            - UNIT=days
    <%_ } _%>
    <%_ if (consoleOptions.includes('zipkin')) { _%>
    jhipster-zipkin:
        image: <%= DOCKER_JHIPSTER_ZIPKIN %>
        ports:
            - 9411:9411
        environment:
            - ES_HOSTS=http://jhipster-elasticsearch:9200
            - ZIPKIN_UI_LOGS_URL=http://localhost:5601/app/kibana#/dashboard/logs-dashboard?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-1h,mode:quick,to:now))&_a=(filters:!(),options:(darkTheme:!f),panels:!((col:1,id:logs-levels,panelIndex:2,row:1,size_x:6,size_y:3,type:visualization),(col:7,columns:!(stack_trace),id:Stacktraces,panelIndex:7,row:1,size_x:4,size_y:3,sort:!('@timestamp',desc),type:search),(col:11,id:Log-forwarding-instructions,panelIndex:8,row:1,size_x:2,size_y:3,type:visualization),(col:1,columns:!(app_name,level,message),id:All-logs,panelIndex:9,row:4,size_x:12,size_y:7,sort:!('@timestamp',asc),type:search)),query:(query_string:(analyze_wildcard:!t,query:'{traceId}')),title:logs-dashboard,uiState:())
    <%_ } _%>

# Uncomment to use the log-data volume
# volumes:
#     log-data:
#         driver: local
